<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
	<script type="text/javascript" charset="utf-8">
		var admin_usermodify_form;
		var admin_usermodify_dlg;
		var lockWindowFun = function() {
			//	$.post('url1', function(result) {
			//		$('#loginDialog').dialog('open');
			//	}, 'json');
		};
		var logoutFun = function() {
			//	$.post('url', function(result) {
			location.replace('loginOut.do');
			//	}, 'json');
		};
		var showMyInfoFun = function() {
			$('#admin_userInfo_dlg').dialog('open');
		};
		var showUserModifyFun = function() {
			$('#admin_usermodify_dlg').dialog('open');
		};
		$('#admin_userInfo_dlg').dialog({
			title : '当前登录用户信息',
			width : 400,
			height : 200,
			closed : true,
			cache : false,
			iconCls : 'icon-tip',
			//href : 'admin/userInfo.jsp',
			modal : true,
			buttons : [ {
				text : '关闭',
				handler : function() {
					$('#admin_userInfo_dlg').dialog('close');
				}
			} ]
		});
		admin_usermodify_dlg = $('#admin_usermodify_dlg').dialog({
			title : '修改当前用户信息',
			width : 350,
			height : 400,
			closed : true,
			cache : false,
			iconCls : 'icon-tip',
			modal : true,
			buttons : [ {
				text : '修改',
				handler : function() {
					$('#admin_usermodify_form').submit();
				}
			}, {
				text : '关闭',
				handler : function() {
					$('#admin_usermodify_dlg').dialog('close');
				}
			} ]
		});
		admin_usermodify_form = $('#admin_usermodify_form').form({
			url : 'userAction/update.do',
			onSubmit : function() {
				if ($('#pwd1').val() == $('#pwd2').val()) {
					return true;
				} else {
					$.messager.alert('提示', '两次密码输入不一致');
					return false;
				}
			},
			success : function(r) {
				r = $.parseJSON(r);//将标准json转成obj
				if (r && r.success) {
					$('#admin_usermodify_dlg').dialog('close');
					$.messager.show({
						title : '提示',
						msg : '修改成功',
						showType : 'show'
					});
				} else {
					if (r.success == false) {
						$.messager.alert('提示', '重新修改');
						$("input[name='pwd']").val('');
						$("input[name='repwd']").val('');
					}
				}
			}
		});
	</script>
	<div id="admin_usermodify_dlg" style="padding: 22px">
		<form id="admin_usermodify_form" method="post">
			<table cellpadding="5">
				<tr>
					<th>ID</th>
					<td><input class="easyui-validatebox" type="text" name="id" readonly="readonly" data-options="novalidate:true"
						value="${sessionScope.user.id}"></input></td>
				</tr>
				<tr>
					<th>编号</th>
					<td><input class="easyui-validatebox" type="text" name="uid" readonly="readonly"
						data-options="novalidate:true" value="${sessionScope.user.uid}"></input></td>
				</tr>
				<tr>
					<th>用户名</th>
					<td><input class="easyui-validatebox" type="text" name="name"
						data-options="novalidate:true,missingMessage:'请输入用户名'"></input></td>
				</tr>
				<tr>
					<th>密码</th>
					<td><input id="pwd1" class="easyui-validatebox" name="pwd" type="password"
						data-options="novalidate:true,missingMessage:'请输入密码'" /></td>
				</tr>
				<tr>
					<th>确认密码</th>
					<td><input id="pwd2" class="easyui-validatebox" name="repwd" type="password"
						data-options="novalidate:true,missingMessage:'重复输入密码'" /></td>
				</tr>
				<tr>
					<th>用户类型</th>
					<td><select class="easyui-combobox" name="type" style="width: 100%" panelHeight="42px">
							<option value="admin">管理员</option>
							<option value="user">普通用户</option>
					</select></td>
				</tr>
				<tr>
					<th>创建时间</th>
					<td><input name="createdatetime" readonly="readonly" data-options="novalidate:true"
						value="<fmt:formatDate value='${sessionScope.user.createdatetime}' pattern='yyyy-MM-dd HH:mm:ss' />" /></td>
				</tr>
			</table>
		</form>
	</div>
	<div id="sessionInfoDiv" style="position: absolute; right: 10px; top: 5px;"></div>
	<div style="position: absolute; right: 20px; bottom: 0px;">
		<a href="javascript:void(0);" class="easyui-menubutton" data-options="menu:'#layout_north_pfMenu',iconCls:'icon-ok'">更换主题</a>
		<a href="javascript:void(0);" class="easyui-menubutton"
			data-options="menu:'#layout_north_kzmbMenu',iconCls:'icon-help'">控制面板</a> <a href="javascript:void(0);"
			class="easyui-menubutton" data-options="menu:'#layout_north_zxMenu',iconCls:'icon-cancel'">注销</a>
	</div>
	<div id="layout_north_pfMenu" style="width: 120px; display: none;">
		<div onclick="changeTheme('default');" title="默认主题">默认主题</div>
		<div onclick="changeTheme('gray');" title="灰色主题">灰色主题</div>
		<div onclick="changeTheme('metro');" title="白色主题">白色主题</div>
		<div onclick="changeTheme('bootstrap');" title="bootstrap主题">浅灰主题</div>
		<div onclick="changeTheme('black');" title="黑色主题">黑色主题</div>
	</div>
	<div id="layout_north_kzmbMenu" style="width: 100px; display: none;">
		<div data-options="iconCls:'ext-icon-user'" onclick="showMyInfoFun();">我的信息</div>
		<div data-options="iconCls:'ext-icon-user_edit'" onclick="showUserModifyFun();">修改信息</div>
	</div>
	<div id="layout_north_zxMenu" style="width: 100px; display: none;">
		<div data-options="iconCls:'ext-icon-door_out'" onclick="logoutFun();">退出系统</div>
	</div>
	<div class="" style="background-image: images/logo.jpg">
		<img src="images/logo.jpg" width="100%" height="98" alt="用户资源管理系统" />
	</div>
	<div id="admin_userInfo_dlg">
		<table>
			<tr>
				<th>&nbsp;</th>
			</tr>
			<tr>
				<th>ID:</th>
				<td><span style="font-size: 12px;">${sessionScope.user.id}</span></td>
				<th>编号:</th>
				<td><span style="font-size: 12px">${sessionScope.user.uid}</span></td>
			</tr>
			<tr>
				<th>&nbsp;</th>
			</tr>
			<tr>
				<th>用户名:</th>
				<td><span style="font-size: 12px">${sessionScope.user.name}</span></td>
				<th>用户类型:</th>
				<td>${sessionScope.user.type}</td>
			</tr>
			<tr>
				<th>&nbsp;</th>
			</tr>
			<tr>
				<th>创建时间:</th>
				<td><fmt:formatDate value="${sessionScope.user.createdatetime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
				<th>最后修改时间:</th>
				<td><fmt:formatDate value="${sessionScope.user.modifydatetime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
			</tr>
		</table>

	</div>
</body>
</html>